package com.kqb.common.security;


import com.kqb.api.auth.bo.UserInfoInTokenBO;

public class AuthUserContext {

    private static final ThreadLocal<UserInfoInTokenBO> AUTH_USER_CONTEXT = new ThreadLocal<>();

    public static void set(UserInfoInTokenBO userInfoInTokenBO) {
        AUTH_USER_CONTEXT.set(userInfoInTokenBO);
    }

    public static UserInfoInTokenBO get() {
        return AUTH_USER_CONTEXT.get();
    }


    public static void clear() {
        if (null != AUTH_USER_CONTEXT.get()) {
            AUTH_USER_CONTEXT.remove();
        }
    }

}
